﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI;

/// <summary>
///GridViewTemplate 的摘要说明
/// </summary>
public class GridViewTemplate : ITemplate
{
    public GridViewTemplate() { }

    private DataControlRowType templateType;
    private string columnName;
    private int colomnType;
    private string content;

    public GridViewTemplate(DataControlRowType type, string colName)
    {
        templateType = type;
        this.columnName = colName;
    }

    public void InstantiateIn(Control container)
    {
        switch (templateType)
        {
            case DataControlRowType.Header:
                Literal lc = new Literal();
                lc.Text = columnName;
                container.Controls.Add(lc);
                break;
            case DataControlRowType.DataRow:
                RadioButton checkBox = new RadioButton();
                checkBox.GroupName = "radiobutton";
                checkBox.ID = "ckb";
                container.Controls.Add(checkBox);
                break;
            default:
                break;
        }
    }
}